package com.googlecode.continuity.plugin.codecomment.client;

import java.util.ArrayList;
import java.util.List;

/**
 * SeverityConstant
 *
 * @author Peter Schmitt <aragos@aragos.de>
 */
public class SeverityConstant extends com.googlecode.continuity.core.client.Enum {
// ------------------------------ FIELDS ------------------------------

  private static List instances = new ArrayList();
  private int order;

// -------------------------- STATIC METHODS --------------------------

  public static List getInstances() {
    return instances;
  }

// --------------------------- CONSTRUCTORS ---------------------------

  /**
   * Mock constructor for GWT
   */
  public SeverityConstant() {
    super(null, 0);
  }

  protected SeverityConstant(String name, int value, int order) {
    super(name, value);
    this.order = order;
    instances.add(this);
  }

// --------------------- GETTER / SETTER METHODS ---------------------

  public int getOrder() {
    return order;
  }

  public static final SeverityConstant SEVERITY_EXCELLENT = new SeverityConstant("excellent", 0, 0);
  public static final SeverityConstant SEVERITY_NOTE = new SeverityConstant("note", 1, 1);
  public static final SeverityConstant SEVERITY_STYLE = new SeverityConstant("style", 2, 2);
  public static final SeverityConstant SEVERITY_WARNING = new SeverityConstant("warning", 3, 3);
  public static final SeverityConstant SEVERITY_ERROR = new SeverityConstant("error", 4, 4);
}
